package ase.eleitweg.common;

/**
 * 
 * 
 * @author DeGi
 */
public class Edge implements java.io.Serializable, ComparableByValue<Edge> {

	private static final long serialVersionUID = 100L;
	
	private String choiceDescription;
	private int id;
	private Node fromNode, toNode;
	
	public boolean isSame(Edge other) {
		if(fromNode.isSame(other.getFromNode()) && toNode.isSame(other.toNode) && id==other.getId()) {
			return true;
		}
		return false;
	}
	
	public boolean isSimilar(Edge other) {
		if(fromNode.isSimilar(other.getFromNode()) && toNode.isSimilar(other.toNode)) {
			return true;
		}
		return false;
	}
	
	public Edge(String choiceDescription, Node fromNode, Node toNode){
		super();
		this.choiceDescription = choiceDescription;
		this.fromNode = fromNode;
		this.toNode = toNode;
	}
	
	public Edge(String choiceDescription, Node fromNode, Node toNode, int id){
		super();
		this.choiceDescription = choiceDescription;
		this.fromNode = fromNode;
		this.toNode = toNode;
		this.id = id;
	}

	public String getDescription() {
		return choiceDescription;
	}

	public void setDescription(String choiceDescription) {
		this.choiceDescription = choiceDescription;
	}

	public Node getToNode() {
		return toNode;
	}

	public void setToNode(Node toNode) {
		this.toNode = toNode;
	}
	
	public Node getFromNode() {
		return fromNode;
	}

	public void setFromNode(Node fromNode) {
		this.fromNode = fromNode;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public int getId() {
		return id;
	}
}
